<template>
  <div style="width: 50%;padding-left: 20%">
    <el-card shadow="never">
      <div slot="header">个人信息<el-button type="primary" style="margin-left: 60%">修改信息</el-button></div>
      <div style="min-height:60vh;width:40%">
        <el-form size="small"  ref="form" :model="form" label-width="100px">
          <el-form-item label="姓名：">
            <span>{{form.name}}</span>
          </el-form-item>
          <el-form-item label="性别：">
            <span>{{form.sex}}</span>
          </el-form-item>
          <el-form-item label="电话：">
            <span>{{form.tel}}</span>
          </el-form-item>
          <el-form-item label="邮箱：">
            <span>{{form.email}}</span>
          </el-form-item>
          <el-form-item label="所属学校：">
            <span>{{form.school}}</span>
          </el-form-item>
          <el-form-item label="所属院系：">
            <span>{{form.faculty}}</span>
          </el-form-item>
          <el-form-item label="所属专业：">
            <span>{{form.major}}</span>
          </el-form-item>
          <el-form-item label="所管理班级：">
            <span>{{form.major}}{{form.cla}}班</span>
          </el-form-item>
        </el-form>
      </div>
    </el-card>
  </div>
</template>
<script>
export default {
  data() {
    return {
      form: {
      },
    };
  },
  methods: {
    selectInfo(){
      this.$axios({
        url: this.$axios.defaults.baseURL+"/teacher/selectinfo",
        method: "post",
        params:{
          uid:sessionStorage.getItem("headuid")
        }
      }).then(res => {
        this.form = res.data;
        let cla = res.data.major+res.data.cla+"班";
        sessionStorage.setItem("headcla",cla);
        sessionStorage.setItem("headmajor",res.data.major);
      })
    },
  },
  mounted() {
    this.selectInfo();
  }
};
</script>
